home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PMWindow.c
-
- Contains: QuickTime sample code
-
- Copyright: © 2000 by Apple Computer, Inc. All rights reserved
-
-
- */
-
- #include "PMWindow.h"
-
- //////////
- //
- // QTFrame_CreateMovieWindow
- // Create a new window to display the movie in.
- //
- //////////
-
- WindowReference CreateMovieWindow (void)
- {
- WindowReference myWindow = NULL;
- WindowObject myWindowObject = NULL;
-
- // Insert NewCWindow.clp here...
-
-
- // create a new window object associated with the new window
- QTFrame_CreateWindowObject(myWindow);
-
- return(myWindow);
- }
-
- //////////
- //
- // QTFrame_SizeWindowToMovie
- // Set the window size to exactly fit the movie and controller (if visible).
- //
- //////////
-
- void SizeWindowToMovie (WindowObject theWindowObject)
- {
- Rect myMovieBounds;
- Movie myMovie = NULL;
-
- #if TARGET_OS_WIN32
- gWeAreSizingWindow = true;
- #endif
-
- if (theWindowObject == NULL)
- goto bail;
-
- myMovie = (**theWindowObject).fMovie;
-
- if (myMovie == NULL)
- return;
-
- // Step 1.
- // Insert Get and Set MovieBox.clp here...
-
-
- // make sure that the movie has a non-zero width;
- // a zero height is okay (for example, with a music movie with no controller bar)
- if (myMovieBounds.right - myMovieBounds.left == 0) {
- myMovieBounds.left = 0;
- myMovieBounds.right = QTFrame_GetWindowWidth((**theWindowObject).fWindow);
- }
-
- // Step 2.
- // Insert SizeWindow.clp here...
-
-
- bail:
- #if TARGET_OS_WIN32
- gWeAreSizingWindow = false;
- #endif
-
- return;
- }